<?php
	class Page_Model extends MySQL{
		function __construct() {
			MySQL::connect();
		}
		//for showMod
		function showModInfo($shopid) {
			$shopInfo = array();
			$sql = "SELECT * FROM Shops WHERE shopid = '$shopid'";
			$result = MySQL::query_array($sql);
			array_push($shopInfo, $result['fullname'], $result['address'], $result['tel'], $result['memo'], $result['food1'], $result['food2'], $result['food3'], $result['food4'], $result['maxofnumber'], $result['perordernumber']);
			return $shopInfo;
		}
		function getShopTableType($shopid) {
			$link = MySQL::connect();
			$shopTableType = array();

			$sql = "SELECT type FROM Tables WHERE shopid = '$shopid' ORDER BY type ASC";
			$result = mysqli_query($link, $sql);
			if($result != FALSE) {
				while ($row = $result->fetch_row()) {
					array_push($shopTableType, $row[0]);
				}
				return $shopTableType;
			}else {
				return FALSE;
			}
		}
	}
?>